#ifndef MASS_SPRING_H
#define MASS_SPRING_H

#include "spring.h"
#include "mass.h"
#include "system.h"

class Mass_Spring : public System{
	public:
		Mass_Spring(std::vector<Mass>&, std::vector<Spring>&);
		~Mass_Spring();
		
		Mass getMass(unsigned int) const;
		unsigned int sizeMasses() const;
		
		Spring getSpring(unsigned int) const;
		unsigned int sizeSprings() const;
		
		//from system
		void draw() const;
		void calculate(unsigned int);
		void calculeVibrationMode(double);
		void initialPosition();
	
	private:
		void populateK(Matrix&);
		void populateM(Matrix&);
		
		//void sortFrequency();
		
		void drawWalls() const;
		void drawMass(unsigned int) const;
		void drawSpring(unsigned int) const;
		
		std::vector<Mass> masses;
		std::vector<Spring> springs;
};

#endif